package com.ft.oa.domain.project;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ft.oa.domain.Attachment;
import com.ft.oa.domain.dto.knowledgeBase.AttachmentDto;
import com.ft.oa.utils.SecurityUtils;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 质保记录
 * @author liyansheng
 * @ClassName WarrantyReturnedRecord
 * @date 2022-1-14 09:36:46
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName(value = "warranty_returned_record",autoResultMap = true)
public class WarrantyReturnedRecord {

    /**
     * 主键id
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 父id
     */
    private Long parentId;

    /**
     * 质保结果 0-已解决 1-解决中 2-未解决
     */
    private int warrantyResult;

    /**
     * 质保结果 0-已解决 1-解决中 2-未解决
     */
    @TableField(exist = false)
    private String warrantyResultName;

    /**
     * 质保日期
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
    private LocalDate warrantyDate;

    /**
     * 质保人员
     */
    private Long warrantyUser;

    /**
     * 质保人员姓名
     */
    @TableField(exist = false)
    private Long warrantyUserName;

    /**
     * 质保耗时（人天）
     */
    private BigDecimal timeConsuming;

    /**
     * 附件
     */
    private String fileIds;

    /**
     * 质保描述
     */
    private String warrantyMemo;

    /**
     * 创建人id
     */
    private Long creator = SecurityUtils.getCurrentUser().getId();

    /**
     * 创建时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd hh:mm:ss")
    private LocalDateTime createTime = LocalDateTime.now();

    /**
     * 修改人id
     */
    private Long editor = SecurityUtils.getCurrentUser().getId();

    /**
     * 修改时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd hh:mm:ss")
    private LocalDateTime updateTime = LocalDateTime.now();
    /**
     * 问题遗留id主键
     */
    @TableField(exist = false)
    private String execid;
    /**
     * 问题描述
     */
    private String problemMemo;
    /**
     * 问题标题
     */
    private String titles;

    @TableField(exist = false)
    private List<AttachmentDto> attachments;

    private String achment;

    /**
     * 项目编码
     */
    @TableField(exist = false)
    private String projectNumber;
}
